Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include<math.h>
- int main()
- {
- float a1,b1,c1,a2,b2,c2,W,Wx,Wy,x,y;
- printf("Poda a1: ");
- scanf("%f",&a1);
- printf("Poda b1: ");
- scanf("%f",&b1);
- printf("Poda c1: ");
- scanf("%f",&c1);
- printf("Poda a2: ");
- scanf("%f",&a2);
- printf("Poda b2: ");
- scanf("%f",&b2);
- printf("Poda c2: ");
- scanf("%f",&c2);
- W = a1*b2-b1*a2;
- Wx = c1*b2-b1*c2;
- Wy = a1*c2-c1*a2;
- if (W != 0){
- printf("Równanie ma jedno rozwiazanie\n");
- x = Wx/W;
- y = Wy/W;
- printf("x=%.2f \n y=&.2f \n",x,y);
- }
- if (W ==0 && Wx == 0 && Wy == 0){
- printf("Rownanie ma nieskonczenie wiele rozwiazan\n");
- }
- if ((W==0 && Wx != 0) || (W==0 && Wy !=0)){
- printf("Rowananie jest sprzeczne, brak rozwiazan\n");
- }
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment